<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
    <title>美策平台</title>
    <link rel="icon" type="image/png" href="/img/icon.png">
    <link rel="stylesheet" type="text/css" href="../datepicker/jquery-ui.min.css">
    <link type="text/css" rel="stylesheet" href="../css/app.css"/>
    <link type="text/css" rel="stylesheet" href="../css/loginMobile.css"/>
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <script src="../datepicker/jquery-ui.min.js"></script>
    <script type="text/javascript" src="/pc/js/all.js"></script>
</head>
<body id="Ibody">
<!--
	制作：陈道祥
	页面：工厂产品
	更新：九哥
-->





<!-----------工厂产品页面---------->
<div class="stepTwo" id="IstepSixFactoryGoods">
    <div class="companyHeadPanel">
        <div class="companyHeadOne">贵公司的产品是？（点击多选）</div>
    </div>
    <div class="companyInfoSpace"></div>
    <div class="modelPanel">
        <div class="businessTitle">针织类：
            &nbsp;以下多选请打钩
        </div>
        <div class="goodsPanel">
            <div class="goodsName">产品名称</div>
            <div class="goodsItemOne">男装</div>
            <div class="goodsItemTwo">女装</div>
            <div class="goodsItemThree">童装</div>
        </div>
        <span id="zhenlist"></span>
    </div>
    <div class="companyInfoSpace"></div>
    <div class="modelPanel">
        <div class="businessTitle">梭织类：
            &nbsp;以下多选请打钩
        </div>
        <div class="goodsPanel">
            <div class="goodsName">产品名称</div>
            <div class="goodsItemOne">男装</div>
            <div class="goodsItemTwo">女装</div>
            <div class="goodsItemThree">童装</div>
        </div>
        <span id="suolist"></span>
    </div>
    <div class="companyInfoSpace"></div>
    <div class="modelPanel">
        <div class="businessTitle">箱包鞋帽类：
            &nbsp;以下多选请打钩
        </div>
        <div class="goodsPanel">
            <div class="goodsName">产品名称</div>
            <div class="goodsItemOne">男装</div>
            <div class="goodsItemTwo">女装</div>
            <div class="goodsItemThree">童装</div>
        </div>
        <span id="baolist"></span>
    </div>
    <div class="companyInfoSpace"></div>
    <div class="companyRemark">备注：方便你的客户找到你、招聘的员工找到你、了解你、信任你，图片尽量上传完善。让客户多了解自己，容易接单成功。细节决定成败，图片清晰。</div>
    <div class="nextStepDiv">
        <!--<span class="prevStep" id="facProPre">上一步</span>-->
        <!--<span class="nextStep" id="facProNext">下一步</span>-->
        <span class="prevStep" onclick="history.go(-1)">返回</span>
        <span class="nextStep" onclick="setSave()">保存</span>
    </div>
</div>
<span id="paramSpan"></span>
<!-----------工厂产品页面---------->





<!-----------提示信息---------->
<div id="errMsg"></div>
<!-----------提示信息---------->
</body>
<script type="text/javascript" src="../js/loginFac.js"></script>
<script>
    (function(){
        getProductList();
    })();
    /**
     * 设置保存
     * */
    function setSave(){
        var userInfo = cacheGet('userInfo'); //获取用户信息
        if (userInfo == 'undefined' || userInfo.token == 'undefined') {
            getErrMsg('没有登录！',''); return;
        }
        var zhenIdStr = $('#zhenIdStr').val();
        var zhenIds = zhenIdStr.split('-');
        var zhens = new Array();
        for (var i=0;i<zhenIds.length;i++) {
            zhens[i] = [
                zhenIds[i],
                $('#zhen-1-'+zhenIds[i]).val(),
                $('#zhen-2-'+zhenIds[i]).val(),
                $('#zhen-3-'+zhenIds[i]).val()
            ];
        }
        var suoIdStr = $('#suoIdStr').val();
        var suoIds = suoIdStr.split('-');
        var suos = new Array();
        for (var i2=0;i2<suoIds.length;i2++) {
            suos[i2] = [
                suoIds[i2],
                $('#suo-1-'+suoIds[i2]).val(),
                $('#suo-2-'+suoIds[i2]).val(),
                $('#suo-3-'+suoIds[i2]).val()
            ];
        }
        var baoIdStr = $('#baoIdStr').val();
        var baoIds = baoIdStr.split('-');
        var baos = new Array();
        for (var i3=0;i3<baoIds.length;i3++) {
            baos[i3] = [
                baoIds[i3],
                $('#bao-1-'+baoIds[i3]).val(),
                $('#bao-2-'+baoIds[i3]).val(),
                $('#bao-3-'+baoIds[i3]).val()
            ];
        }
        //console.log(zhens,suos,baos); return;
        var data = {
            app_access: app_access,
            token: userInfo.token,
            type: userInfo.type,
            cate: userInfo.cate,
            zhens:zhens,
            suos:suos,
            baos:baos
        };
        $.ajax({
            type: 'post',
            url: getDomain() + 'fac-pro-set',
            data: data,
            success: function (res) {
                //console.log(res); return;
                if (res.code != 0) {
                    getErrMsg(res.msg,''); return;
                }
                var facProArray = []
                $('.stepTwo input').each(function () {
                    if ($(this).prop('checked')) {
                        facProArray.push(0)
                    }
                })
                
                var facPro = ''
                if (facProArray.length > 0) {
                    facPro = true
                } else {
                    facPro = false
                }
                
                cacheSet('facPro', facPro);
                window.location.href = '/h5/login/facList.html';
            },
            error:function(){
                getErrMsg('操作失败！',''); return;
            }
        });
    }
</script>
</html>